/****** Object:  Stored Procedure dbo.CGO_AccountGet    Script Date: Monday, March 07, 2011 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'dbo.CGO_AccountGet') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure dbo.CGO_AccountGet
GO

/* -------------------------------------------------------------------------------------
/   AccountGet
/  ------------------------------------------------------------------------------------- */
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

CREATE PROCEDURE dbo.CGO_AccountGet
	@PortalID int	,
	@UserID int	
AS

SELECT
	M.UserID,
	U.Username,	
	PortalID,
	Token,
	M.LastUpdateDate
FROM dbo.CGO_Account M
INNER JOIN dbo.Users U ON M.UserID = U.UserID
WHERE
	M.UserID = @UserID
	AND PortalID = @PortalID
	
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO